Re: darwin pgsql patches - Mailing list pgsql-patches

From Peter Bierman
Subject Re: darwin pgsql patches
Date
Msg-id v03130310b652309ce853@[17.202.21.230]
Whole thread Raw
In response to Re: darwin pgsql patches  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: darwin pgsql patches
List pgsql-patches
At 12:30 PM -0500 12/2/00, Tom Lane wrote:

>You might want to think about having the template/darwin file add
>-D__darwin__ to CPPFLAGS, instead of putting a #define in port/darwin.h.

This is what I ended up with.


My plans for the #include "../backend/port/darwin/sem.h" are to change the Makefile.in in the directories that have
sourcethat needs to #include my "sem.h" to add a -I../backend/port/darwin/  That way the change happens from inside the
sourcetree, no worries about the header search tree moving. Any objections? 

Finally, after one of our kernel engineers gave me the skinny on semaphore support, I almost have it working correctly.
I'vemade a LOT of changes to the qnx shim to use named POSIX semaphores. The general method sort of the same, and I've
alsoadded a ton of conditional debugging output. 

Two questions:

Q1) should I submit with the debugging stuff in the code (conditionalized off of course). It's useful if someone wants
tosee how it works, but it makes the code a bit harder to read. 

Q2) As I'm 95% done making it work as a shim, I notice that the Sem stuff is shimmed in Postgres also, and I wonder if
there'dbe objections to me conditionalizing it there. It would be a LOT easier to change the InternalIpc...() to use
POSIXnamed semaphores vs my current route of implementing SysV semaphores as a shim on top of POSIX ones. 

I could conditionalize the code on HAS_POSIX_SEMAPHORES or DARWIN_HAS_POSIX_SEMAPHORES, and only set it on darwin for
now.Other platforms could try it and migrate over if it works. Part of me thinks this would be better for PG as a
whole,moving towards POSIX and all that... 

Comments?


Also, one of the things that got me into a mess is that the postmaster allocates some sem arrays via semget(), and then
letsits children use the semids that were returned in the parent process. I can't find any docs that say this is legal,
thoughobviously it must work. The Vahalia book on Unix Internals describes implementation that explains *why* it works,
butsort off alludes that it shouldn't. 

Also, should I be asking these questions on pg-hackers instead of here?

-pmb

--
"Every time you provide an option, you're asking the user to make a decision.
 That means they will have to think about something and decide about it.
 It's not necessarily a bad thing, but, in general, you should always try to
 minimize the number of decisions that people have to make."
 http://joel.editthispage.com/stories/storyReader$51



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: darwin pgsql patches
Next
From: Tom Lane
Date:
Subject: Re: darwin pgsql patches